Conversation
lslezak
left a comment
There was a problem hiding this comment.
Looks OK to me, but someone with Rust knowledge should check it as well... 😃
imobachgs
left a comment
There was a problem hiding this comment.
It looks good to me. Just a few suggestions.
| const DIR : &str = "/usr/share/YaST2/locale/"; | ||
| let entries = read_dir(DIR).context("Reading YaST2 locale")?; | ||
| for entry in entries { | ||
| let entry = entry.context("Failed to read entry in YaST2 locale dir")?; |
There was a problem hiding this comment.
So we are returning an error if we cannot read any of the dirs, right?
There was a problem hiding this comment.
yeah, any read failure result in error. I would not expect it unless there is some issue with fs.
There was a problem hiding this comment.
The /usr/share/YaST2/locale/ directory is owned by the base yast2 package so the error should not happen normally.
Co-authored-by: Imobach González Sosa <igonzalezsosa@suse.com>
Co-authored-by: Imobach González Sosa <igonzalezsosa@suse.com>
b5175a7 to
68ac11a
Compare
68ac11a to
51ca721
Compare
| const DIR : &str = "/usr/share/YaST2/locale/"; | ||
| let entries = read_dir(DIR).context("Reading YaST2 locale")?; | ||
| for entry in entries { | ||
| let entry = entry.context("Failed to read entry in YaST2 locale dir")?; |
There was a problem hiding this comment.
The /usr/share/YaST2/locale/ directory is owned by the base yast2 package so the error should not happen normally.
Problem
There are some string that come from backend and it is displayed to user. But we do not set localization for those strings.
trello: https://trello.com/c/Jp7S5kwh/3398-5-agama-add-support-for-translating-the-messages-from-the-d-bus-interface
Solution
Implement in Locale method to enlist all possible backend localization ( so far only for ruby based ones ) and allow to set localization. In other services have helper that will set initial localization (1) and also catch signal when it is changed (2).
As part of this PR also drop no longer used Language Service.
(1)
(2) see
on_ui_locale_changeTesting
Screenshots
Example localization in czech ( in czech is only data comming from dbus ):